package com.ruoyi.logistic.service.impl;

import com.ruoyi.logistic.domain.QuotationType;
import com.ruoyi.logistic.mapper.QuotationMapper;
import com.ruoyi.logistic.mapper.QuotationTypeMapper;
import com.ruoyi.logistic.service.QuotationTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QuotationTypeServiceImpl implements QuotationTypeService {
    @Autowired
    private QuotationTypeMapper quotationTypeMapper;
    @Autowired
    private QuotationMapper quotationMapper;
    @Override
    public List<QuotationType> selectAll() {
        List<QuotationType> quotationTypes = quotationTypeMapper.selectAll();
        for (QuotationType quotationType : quotationTypes){
            quotationType.setQuotationList(quotationMapper.findByQuotationTypeId(quotationType.getId()));
        }
        return quotationTypes;
    }
}
